# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=tmuxinator
pkgver=3.0.5
pkgrel=0
pkgdesc="manage complex tmux sessions easily"
url="https://github.com/tmuxinator/tmuxinator"
arch="noarch"
license="MIT"
depends="ruby ruby-erubi ruby-thor ruby-xdg"
checkdepends="ruby-rspec"
options="!check" # requires coveralls
source="https://github.com/tmuxinator/tmuxinator/archive/v$pkgver/tmuxinator-$pkgver.tar.gz
	replace-erubis-with-erubi.patch
	tmuxinator-use-new-xdg-version.patch
	"

build() {
	gem build tmuxinator.gemspec
}

check() {
	rspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--bindir "$pkgdir/usr/bin" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		tmuxinator

	rm -r "$gemdir"/cache \
		"$gemdir"/extensions \
		"$gemdir"/doc \
		"$gemdir"/gems/tmuxinator-$pkgver/spec
}

sha512sums="
fa40c243499bee4baab4f0c5c35de79287721056f27fc691706ae60e24d159261ba7359b6a66decf57a9a5bd5d05b4b84248a468752dd93f3886f3b894303b45  tmuxinator-3.0.5.tar.gz
a05d992bd791de1b75708c146fe44a4ee8ab690cdf45ef564afa67eb114e7beda2f52db3a100af6d553e3721fc7a1d95bc3ef1b8023d7252aedb44e4e0312b5e  replace-erubis-with-erubi.patch
1fd0a35f79f564164ef425063dc37f376007d37fe2f662e7c01b7b5e82b6492ac7f63d0c5fcdc6a44a1d5c6645bc1f57fb72cd5b4ea7cc4eaec1d4d9284d3c9c  tmuxinator-use-new-xdg-version.patch
"
